home *** CD-ROM | disk | FTP | other *** search
/ Invisible Universe / Invisible Universe (1995)(Voyager)[Mac-PC].iso / mac / MOVIES / MIAWS / _NAV.DIR / 00003_Script_ setUpNavButtons < prev    next >
Text File  |  1995-11-13  |  6KB  |  274 lines

  1. on setUpNavButtons
  2.   global gNavButtonList
  3.   --  if voidP(gNavButtonList) then
  4.   set gNavButtonList to [:]
  5.   --    shortNB 3,"closeButton" --QD box
  6.   --    shortNB 4,"titleBar" --QD box
  7.   --    shortNB 5,"views" --QD box
  8.   --    shortNB 6,"info" --QD box
  9.   --    shortNB 7,"hotspots" --QD box
  10.   --    shortNB 8,"photos" --QD box
  11.   --    shortNB 9,"hideAll" --QD box
  12.   --    sort gNavButtonList
  13.   --  end if
  14. end setUpNavButtons
  15.  
  16. on shortNB c,s
  17.   global gNavButtonList
  18.   addprop gNavButtonList,c, birth(script "nb",c,s)
  19. end
  20.  
  21. on closeButton
  22.   global gMouseDownTime
  23.   
  24.   set gMouseDownTime = the ticks
  25.   
  26.   tell the stage to hidePalette
  27.   lCloseNavPalette
  28. end closeButton
  29.  
  30. on lOpenNavPalette
  31.   global gNavPalette, gFixPalObjNav, gNavOffScreen
  32.   global gUpdateNavPalette
  33.   
  34.   --put ">>> lOpenNavPalette->gUpdateNavPalette" && gUpdateNavPalette
  35.   
  36.   continue
  37.   
  38.   if gUpdateNavPalette then exit
  39.   
  40.   if not voidP(gFixPalObjNav) then gFixPalObjNav(mPatchIt) 
  41.   updateStage
  42.   
  43.   --put ">>> lOpenNavPalette->gNavOffScreen" && gNavOffScreen
  44.   
  45.   if gNavOffScreen then
  46.     set gNavOffScreen = 0
  47.     open gNavPalette
  48.     set the rect of gNavPalette to offset(the rect of gNavPalette, 5000, -5000)
  49.     updateStage    
  50.   end if
  51.   
  52.   
  53. end lOpenNavPalette
  54.  
  55. on lCloseNavPalette alsoCloseGloss
  56.   
  57.   global gNavPalette, gPalCloseTicks, gNavOffScreen
  58.   global gGlossPalette, gGlossOffScreen
  59.   
  60.   if not gNavOffScreen then
  61.     set gNavOffScreen = 1
  62.     set the rect of gNavPalette to offset(the rect of gNavPalette, -5000, 5000)
  63.     set update = 1  
  64.   else
  65.     set update = 0
  66.   end if
  67.   
  68.   set glossClose = 0
  69.   
  70.   if not voidP(gGlossPalette) then
  71.     if not voidP(alsoCloseGloss) and not gGlossOffScreen then
  72.       set gGlossOffScreen = 1
  73.       set the rect of gGlossPalette to offset(the rect of gGlossPalette, -5000, 5000)
  74.       set glossClose = 1
  75.       set update = 1  
  76.     end if
  77.   end if
  78.   
  79.   set gPalCloseTicks = the ticks
  80.   
  81.   if update then tell the stage to updateStage  
  82.   close gNavPalette
  83.   if glossClose then close gGlossPalette
  84.   pause
  85.   
  86. end lCloseNavPalette
  87.  
  88. on titleBar
  89.   global gNavPalette, gMV, gMH
  90.   
  91.   put the mouseH into mH
  92.   put the mouseV into mV
  93.   
  94.   repeat while the mouseDown
  95.     tell the stage to set gMH to the mouseH
  96.     tell the stage to set gMV to the mouseV
  97.     
  98.     if gMH < 640 and gMH > 0 and gMV <  480 and gMV > 30 then
  99.       put the rect of gNavPalette into wRect
  100.       set the rect of gNavPalette to offset(wRect, the mouseH-mH, the mouseV-mV)
  101.       tell the stage to updateStage
  102.     end if
  103.     
  104.   end repeat
  105.   CalculateStageSize    
  106. end titleBar
  107.  
  108. on views
  109.   --put ">>> views" 
  110.   doViewPop
  111. end views
  112.  
  113. on info
  114.   tell the stage to infoToggle
  115. end info
  116.  
  117. on hotspots
  118.   tell the stage to toggleHotSpots
  119.   -- put ">>> hotspots"
  120. end hotspots
  121.  
  122. on photos
  123.   --put ">>> photos pop up stub"
  124.   doPhotoPop
  125. end photos
  126.  
  127. on hideAll
  128.   global gGlossPalette
  129.   
  130.   --put ">>> hide All stub"
  131.   --set t = the ticks
  132.   
  133.   --  beep
  134.   --  put ">>>1" && the ticks - t
  135.   lCloseNavPalette(1) -- tell it to close the glossary too!
  136.   
  137.   --  beep
  138.   --  put ">>>2" && the ticks - t
  139.   --tell gGlossPalette to lCloseGlossPalette
  140.   
  141.   tell the stage to hideAllButImage
  142.   
  143.   --  beep
  144.   --  put ">>>3" && the ticks - t
  145.   
  146. end hideAll
  147.  
  148.  
  149. on updatePalPopUps
  150.   global gNavPalette, gNavOffScreen
  151.   setUpView
  152.   setUpPhoto
  153.   tell the stage to setUpHotSpots  
  154.   if gNavOffScreen then tell gNavPalette to lOpenNavPalette
  155. end updatePalPopUps
  156.  
  157. on setUpPhoto
  158.   global gCurLabelList, gNavPalette, gCurLabelProp
  159.   
  160.   if count(gCurLabelList) > 2 then
  161.     set lists = getAt(gCurLabelList, 3)
  162.     set photos = getAProp(lists, #PHOTOS)
  163.   end if
  164.   
  165.   tell gNavPalette to setPhotosPopUp(photos)
  166. end setUpPhoto
  167.  
  168.  
  169. on setUpView
  170.   global gNavPalette, gCurLabelProp, gLabels
  171.   global gUpdateViewsMenuP --, gLastFrame
  172.   
  173.   --put ">>>setUpView"
  174.   
  175.   if not gUpdateViewsMenuP then exit
  176.   
  177.   --set gLastFrame = -1
  178.   
  179.   --put ">>>setUpView... updating"
  180.   
  181.   --
  182.   --
  183.   -- Get the label list for the MAIN view, as this controls the views menu
  184.   --
  185.   set mainView = getMainView(string(gCurLabelProp))
  186.   --put ">>> mainView" && mainView
  187.   set MainLabelList = getAProp(gLabels, mainView)
  188.   
  189.   if count(MainlabelList) > 2 then
  190.     set lists = getAt(MainLabelList, 3)
  191.     set views = getAProp(lists, #VIEWS)
  192.   end if
  193.   
  194.   
  195.   --  if count(gCurLabelList) > 2 then
  196.   --    set lists = getAt(gCurLabelList, 3)
  197.   --    set views = getAProp(lists, #VIEWS)
  198.   --  end if
  199.   
  200.   
  201.   if voidP(views) then
  202.     set byType = 1
  203.   else if (count(views) = 1) then
  204.     set byType = 1
  205.   else
  206.     set byType = 0
  207.   end if
  208.   
  209.   if byType then    
  210.     set s = char 5 of (string(gCurLabelProp))
  211.     --    set s = string(gCurLabelProp)
  212.     --    set s = char length(s) of s
  213.     tell gNavPalette to setView(views, s)
  214.   else  
  215.     tell gNavPalette to setView(views)
  216.   end if
  217.   
  218. end setUpView
  219.  
  220. on getMainView label
  221.   global gNonVisibleSingles
  222.   
  223.   if ((char 5 of label = "V") or (getOne(gNonVisibleSingles, char 1 to 5 of label) > 0)) then
  224.     return char 1 to 5 of label
  225.   else
  226.     return (char 1 to 4 of label) & "V"
  227.   end if
  228. end getMainView
  229.  
  230.  
  231. on openPopMenu
  232.   global gOpenPopMenu
  233.   
  234.   set gOpenPopMenu = 1
  235.   
  236.   --put ">>> openPopMenu"
  237.   
  238.   if the machineType = 256 then 
  239.     --
  240.     --
  241.     -- Make sure that the search path is used for this
  242.     -- (works for mac, but not for PC)
  243.     --
  244.     --openXLib "POPMENU.DLL" 
  245.   else 
  246.     --openXLib "PopUp Menu XObj"
  247.     openXLib "HierPopUp.XFCN"
  248.   end if
  249. end openPopMenu
  250.  
  251. on rolloNew theLine
  252.   set command = item 3 of theLine & "rollo(" & item 4 of theLine & "," & item 5 of theLine & ")"
  253.   --  put command 
  254.   do command 
  255. end rolloNew
  256.  
  257. on pressNew theLine
  258.   set command = item 3 of theLine & "press"
  259.   --  put command && quote & theLine & quote
  260.   do command && quote & theLine & quote
  261. end
  262.  
  263. on doScriptNew theLine
  264.   set command = item 3 of theLine & "doScript"
  265.   --  put command && quote & theLine & quote 
  266.   do command && quote & theLine & quote
  267. end
  268.  
  269. on normNew theLine
  270.   set command = item 3 of theLine & "norm"
  271.   --  put ">>> normNew " & command && quote & theLine & quote
  272.   do command && quote & theLine & quote
  273. end
  274.